﻿<%@ Page Title="Information Management System" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="EditUserInfo.aspx.cs" Inherits="CARMS.Admin.EditUserInfo" %>

<%@ Register Src="~/Controls/RequiredMark.ascx" TagName="ReMark" TagPrefix="ucc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script>
        function OpenEmployeeList(strUserID) {
            $dialog('<%=ResolveUrl("~/Grids/Employeelist.aspx?UserID=") %>' + strUserID, { width: 700, height: 550 }, function(result) {
                if (result!=null && result.length == 36) {
                    $get('<%=fieldHiddenId.ClientID %>').value = result;
                    $get('<%=btnRefreshEmployee.ClientID %>').click();
                }
            });
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
           <fieldset>
                <legend>User Detail</legend>
            <asp:HiddenField ID="fieldHiddenId" runat="server" />
            <asp:Button ID="btnRefreshEmployee" runat="server" OnClick="btnRefreshEmployee_Click"
                Text="Delete" SkinID="Hidden" CausesValidation="false" />
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <vs:FormPanel ID="fpUserInfo" runat="server" RepeatColumns="2">
                            <Items>
                                <vs:FormItem HeaderText="Login Name">
                                    <ContentTemplate>
                                   
                                        <asp:TextBox ID="txtLoginName" runat="server" MaxLength="50" Text='<%# Bind("LoginName") %>'></asp:TextBox>
                                         <ucc:ReMark ID="ReMark1" runat="Server"></ucc:ReMark>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationExpression="^[0-9a-zA-Z]+$"
                                            ErrorMessage="The login name should only contains number or alphabetic characters."
                                            Display="Dynamic" ControlToValidate="txtLoginName"></asp:RegularExpressionValidator>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLoginName"
                                            Display="None" ErrorMessage="Please input login name" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Relative Employee" Visible="false">
                                    <ContentTemplate>
                                        <asp:Label runat="server" ID="lblRelativeEmployee"></asp:Label>
                                        <asp:ImageButton ID="btnRemove" runat="server" SkinID="Delete" OnClick="btnRemove_Click"
                                            Visible="false" ToolTip="Remove Employee"/>
                                        <asp:ImageButton ID="btnSelectEmployee" runat="server" SkinID="Employee"  ToolTip="Select Employee"/>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Full Name">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtFullName" runat="server" MaxLength="50" Text='<%# Bind("FullName") %>'></asp:TextBox>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Phone">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtPhone" runat="server" MaxLength="50" Text='<%# Bind("Tel") %>'></asp:TextBox>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Mobile">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtMobile" runat="server" MaxLength="50" Text='<%# Bind("Mobile") %>'></asp:TextBox>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Email">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="50" Text='<%# Bind("Email") %>'></asp:TextBox>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Address" ColumnSpan="2">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtAddress" runat="server" MaxLength="200" Width="544px" Text='<%# Bind("Address") %>'></asp:TextBox>
                                    </ContentTemplate>
                                </vs:FormItem>
                                       <vs:FormItem HeaderText="Status" ColumnSpan="2">
                                    <ContentTemplate>
                                      <asp:RadioButtonList RepeatColumns="2" RepeatDirection="Horizontal" runat="server" ID="radioStatus"></asp:RadioButtonList>
                                    </ContentTemplate>
                                </vs:FormItem>
                                <vs:FormItem HeaderText="Roles" ColumnSpan="2">
                                    <ContentTemplate>
                                   
                                        <asp:CheckBoxList runat="server" ID="chkRoles" RepeatDirection="Horizontal" RepeatColumns="3">
                                        </asp:CheckBoxList>
                                        
                                        <vs:CheckBoxListRequiredFieldValidator ID="CheckBoxListRequiredFieldValidator1" runat="server"
                                            Display="None" SetFocusOnError="True" ControlToValidate="chkRoles" ErrorMessage="Please select at least one role for user."></vs:CheckBoxListRequiredFieldValidator>
                                    </ContentTemplate>
                                </vs:FormItem>
                                
                            </Items>
                        </vs:FormPanel>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="text-align: center; margin-top: 10px">
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"></asp:Button>
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false"
                                OnClick="btnCancel_Click" />
                        </div>
                    </td>
                </tr>
            </table>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                ShowSummary="False" />
                </fieldset>
        </ContentTemplate>
        
    </asp:UpdatePanel>
</asp:Content>
